home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
invest.dir
/
00098_Script_Inv Frequency Obj
< prev
next >
Wrap
Text File
|
1997-05-26
|
7KB
|
263 lines
--Inv Frequency Obj
property pPuppetSpriteList, pHarptones, pHarpnotes, pHarpnum, pStart
property pSliderPos, pTesttone, pHarpString,
property pFirstNoteSndCastNum, pFirstWaveCastNum, pFirstNotePictCastNum
property pFirstBlueWaveCastNum, pFirstHarpCastNum
property pFirstButtonSprite
-- tj&dl
property pNewHarp, pOldHarp
property pSliderBall
property pSliderConstraint -- sprite num of QD rect to constrain ball
property pNotesMatched
property pSpeakerSprite
property pSpeakerList
property pCurrentSpeaker
property pMaxSpeakers
property pSpeakerFlag
property pStartSpeaker
------------------------------------------------------------ò
on mInit me
set pPuppetSpriteList = [4,5,6,12,13,14,15,16,17,18,20]
set pFirstNoteSndCastNum = the number of cast "C1.AIFF"
set pFirstWaveCastNum = the number of cast "C.scale"
set pFirstNotePictCastNum = the number of cast "IPFBBC"
set pFirstBlueWaveCastNum = the number of cast "IPFWVC.PIC"
set pFirstHarpCastNum = the number of cast "IPFHARP1.mov"
set pFirstButtonSprite = 13
set pStartSpeaker = the number of member "speaker1.pic.8bit"
set pCurrentSpeaker = 0
set pMaxSpeakers = 6
set pSpeakerSprite = 20
set pSliderBall = 4
set pSliderConstraint = 5
mActivate(me)
return me
end mInit
------------------------------------------------------------ò
on mActivate me
repeat with x in pPuppetSpriteList
puppetSprite x, true
end repeat
set pHarpnotes = [4]
set pHarptones = [24]
mInitHarp me
-- set the default of harp to harp 5
set pOldHarp = 9
set pNewHarp = 9
set pHarpnum = 5
puppetsprite pNewHarp, True
set the castnum of sprite pNewHarp = 0
mChangeHarp me
set pSpeakerFlag = #STOP
set pNotesMatched = 0
set the constraint of sprite pSliderBall = pSliderConstraint
end mActivate
------------------------------------------------------------ò
on mClose me
repeat with n = 20 down to 2
set the puppet of sprite n = 0
set the visible of sprite n = 1
end repeat
puppetsprite pNewHarp, fAlse
puppetsprite pOldHarp, fAlse
repeat with n = 2 to 20
set the puppet of sprite n = 0
set the visible of sprite n = 1
end repeat
set the constraint of sprite pSliderBall = 0
puppetsprite 33, false
end mClose
------------------------------------------------------------ò
on mInitHarp me
set pHarptones = [12,7,4,0,11,9,5,2,13,10,8,3,23,18,6,4,19,15,11,7,21,19,16,14]
end mInitHarp
------------------------------------------------------------ò
on mAnimateSpeaker me
if the movieRate of sprite 12 = 1 then
if pSpeakerFlag = #ANIMATESPEAKER then
set pCurrentSpeaker = pCurrentSpeaker + 1
if pCurrentSpeaker > pMaxSpeakers then set pCurrentSpeaker = 0
set the castNum of sprite pSpeakerSprite = member( pStartSpeaker + pCurrentSpeaker)
if the movieTime of sprite 12 >= the stopTime of sprite 12 then
set pSpeakerFlag = #STOP
set pCurrentSpeaker = 0
set the castNum of sprite pSpeakerSprite = member( pStartSpeaker)
end if
end if
end if
end mAnimateSpeaker
------------------------------------------------------------ò
on mPlayHarp me
set duration = 124
set the movietime of sprite 12 to pStart
set the movierate of sprite 12 to 1
set the stopTime of sprite 12 to (pStart + duration)
end mPlayHarp
------------------------------------------------------------ò
on mPlayAllNotes me
set the movieTime of sprite 12 to 0
set the movieRate of sprite 12 to 1
end mPlayAllNotes
------------------------------------------------------------ò
on mPlaytone me
set pSpeakerFlag = #ANIMATESPEAKER
set test to the name of cast (pFirstNoteSndCastNum + pTesttone) -- used to be -1 tj&dl
puppetSound test
end mPlaytone
------------------------------------------------------------ò
on mStringClick me
set pSpeakerFlag = #ANIMATESPEAKER
set pHarpString to the clickOn-12
set pStart = (4-pHarpString)*124
-- play harp animation
mPlayHarp(me)
-- show harp string waveform
mUpdateHarpWaveform me
end mStringClick
------------------------------------------------------------ò
on mSliderClick me
set the movierate of sprite 12 = 0
updatestage
repeat while the mousedown
put the mouseV into pSliderPos
if pSliderPos < 75 then set pSliderPos = 75
if pSliderPos > 295 then set pSliderPos = 295
set the locV of sprite pSliderBall = mouseV()
updateStage
end repeat
set pTesttone = 23 - integer((pSliderPos-75)/10)
set nearnestNote = (23-pTesttone)*10+75
set the locv of sprite 4 to nearnestNote
updateStage
set the castnum of sprite 18 to (pFirstWaveCastNum + pTesttone)
updateStage
-- play the test tone
mPlaytone(me)
-- compare test tone and harp tone to see if they match
mTestTone me
end mSliderClick
------------------------------------------------------------ò
on mHarpNoteClick me
set pHarpnum to the clickOn - 5
set pOldHarp = pNewHarp
set pNewHarp = the clickOn
puppetsprite pOldHarp, false
puppetsprite pNewHarp, True
set the castnum of sprite pNewHarp = 0
go the frame
cursor 4
mChangeHarp me
set the castnum of sprite 17 to the number of cast "LeftBlank"
set the castnum of sprite 18 to the number of cast "RightBlank"
cursor -1
updateStage
end mHarpNoteClick
------------------------------------------------------------ò
on mTestTone me
if pHarpString <> 0 then
if pTesttone = getAt(pHarpnotes,pHarpString) then
--tj&dl counting routine to test for all four notes being matched
set pNotesMatched = pNotesMatched + 1
if pNotesMatched = 4 then
set pNotesMatched = 0
set TEMP = pTestTone
set TEMP = TEMP mod 12
set the castnum of sprite (12 + pHarpString) to (pFirstNotePictCastNum + TEMP)
mPlayAllNotes me
updateStage
else
set TEMP = pTestTone
set TEMP = TEMP mod 12
set the castnum of sprite (12 + pHarpString) to (pFirstNotePictCastNum + TEMP)
mPlayHarp me
updateStage
end if
end if
end if
end mTestTone
------------------------------------------------------------ò
on mUpdateHarpWaveform me
-- get value of harp string
set temp = getAt(pHarpnotes,pHarpString)
set the castnum of sprite 17 to (pFirstBlueWaveCastNum + temp)
updateStage
end mUpdateHarpWaveform
------------------------------------------------------------ò
on mChangeHarp me
set the castnum of sprite 12 to pFirstHarpCastNum - 1 +pHarpnum
updateStage
set temp = (pHarpnum-1)*4
repeat with x = 1 to 4
put pHarptones && temp+x
setAt(pHarpnotes,x,getAt(pHarptones,temp+x))
set pStartNumberCastNum = the number of cast "IPFRB1.pic"
set the castnum of sprite x+pFirstButtonSprite-1 to (pStartNumberCastNum - 1 + x)
end repeat
updateStage
set pNotesMatched = 0
end mChangeHarp
------------------------------------------------------------ò